package ch9;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArrayRepeat {
    public static void main(String[] args) {
        int[] a = {0,1,2,3,4,2};
        for(int i=0;i<a.length/2;i++){
            //a[i]和 a[a.length-1-i] 调换位置

        }
        for (int i = 0; i < a.length; i++) {
            for (int i2 = i + 1; i2 < a.length ; i2++) {
                if (a[i] == a[i2]) {
                    System.out.println("第" + (i + 1) + "个和第" + (i2 + 1) + "个元素相同，值为" + a[i]);
                }
            }
        }
    }
}
